import request from "@/request/request";
import qs from "qs"

// 创建精品推荐API
export const JingpinAPI = () => request.get("/products/recommend")

// 创建热门兑换API
export const RemenAPI = () => request.get('/products/hot')

// 发送手机号码
export const sendSMSAPI = (params) => request.post("/sendSMS", qs.stringify(params))

// 登录请求
export const PhoneLoginAPI = (params) => request.post("/phoneRegin", qs.stringify(params))

// 微信扫码登录
export const wxLoginAPI = (params) => request.post("/wechatUsers/PCLogin", qs.stringify(params))

// 手机绑定微信
export const bindingAPI = (params) => request.post("/wechatUsers/binding", qs.stringify(params))

// 获取用户信息
export const userProfilesAPI = () => request.get('/shop/userProfiles')

// 获取商品详情
export const goodsDetailAPI = (params) => request.get(`/products/${params}`)

// 加入到购物车
export const addToCartAPI = (params) => request.post("/shop/carts/add", qs.stringify(params))

// 全部商品
export const goodsSearchAPI = (params) => request.get('/products', { params })

// 查看购物车信息
export const cartDetailAPI = () => request.get('/shop/carts')

// 删除购物车
export const deleteCartAPI = (params) => request.delete(`/shop/carts?productIds=${params}`)
